class Solution:
    def findTheLongestSubstring(self, s: str) -> int:
        dmin = {}
        dmax = {}
        dchr = {}
        yuanyin = {'a', 'e', 'i', 'o', 'u'}
        for i in range(26):
            dchr[chr(ord('a') + i)] = 0
        dchr['a'] = 1
        dchr['e'] = 2
        dchr['i'] = 4
        dchr['o'] = 8
        dchr['u'] = 16
        
        dmin[0] = -1
        cur = 0
        for i, c in enumerate(s):
            cur ^= dchr[c]
            dmax[cur] = i
            if cur not in dmin:
                dmin[cur] = i
        
        ans = 0
        for i in range(32):
            if (i in dmin) and (i in dmax):
                ans = max(ans, dmax[i] - dmin[i])
        
        return ans